package com.boang.tree;

import java.util.Objects;

/*
  @author: 13813
  @date: 2024/11/29 11:17
*/
public class Student implements Comparable<Student> {
    public String name;
    public int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    /*
       返回：
          负整数、零或正整数，根据此对象是小于、等于还是大于指定对象。
       两件事：
           排序
           去重
     */
    @Override
    public int compareTo(Student o) {
        return o.age - this.age;
    }
}
